<?php
/*-----
管理后台站点路由群组 START
-----*/
$_ap = config('site.route.prefix.admin', 'admin');

Route::group(['prefix' => $_ap, 'namespace' => 'Admin', 'middleware' => ['block:admin', 'web']], function () {

    Route::get('/', function() {
        return redirect(config('site.route.prefix.admin', 'admin') . '/auth/login');
    });

    Route::group(['prefix' => 'auth'], function () {
        $Authority = 'AuthorityController@';
        # 退出
        Route::get('logout', $Authority.'getLogout');
        # 登录
        Route::get('login', $Authority.'getLogin');
        Route::post('login', $Authority.'postLogin');
    });



    Route::group(['prefix' => '', 'middleware' => ['multi-site.auth:admin']], function () {

        Route::get('dashboard', 'DashboardController@getIndex');

        //重建缓存
        Route::get('cache', 'AssistantController@getRebuildCache');
        /*
         * ----------------------------------------
         * 自定义二次开发区域 START
         * ----------------------------------------
         */

        //内容管理
        #分类
        Route::resource('category', 'CategoryController');
        #文章
        Route::resource('article', 'ArticleController');
        #图链
        Route::resource('picture', 'PictureController');

        //自定义模型管理

        /*
         * ----------------------------------------
         * 自定义二次开发区域 END
         * ----------------------------------------
         */

        //用户管理
        Route::get('me', 'MeController@getMe');
        Route::put('me', 'MeController@putMe');

        Route::resource('user', 'UserController');
        Route::get('user/purview/{rid}', 'UserController@getPurview');
        Route::resource('role', 'RoleController');
        Route::resource('permission', 'PermissionController');

        //系统管理
        Route::get('option', 'OptionController@getOption');
        Route::put('option', 'OptionController@putOption');
        Route::resource('log', 'LogController');
    });

});
/*-----
管理后台站点路由群组 END
-----*/